home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n10.arc / COMPUTE.DOC < prev    next >
Text File  |  1990-04-27  |  2KB  |  43 lines

  1. UTILITIES 
  2. MICHAEL J. MEFFORD
  3. Vol. 9, No. 10
  4. COMPUTE
  5.  
  6. Command
  7.  
  8. Purpose: A five-function calculator (addition, subtraction, multiplication, 
  9.          division, and modulo functions) that works directly from the DOS 
  10.          command line prompt.
  11.  
  12. Format:    COMPUTE arithmetic expression
  13.  
  14. Remarks: COMPUTE accepts decimal numbers only, and the operators in its 
  15.          arithmetic expression are +, -, *, /, and %.  Note that the % symbol 
  16.          does not stand for percent, but rather designates the module operator,
  17.          which returns the remainder of an integer division.  
  18.          (Example:  COMPUTE 8 % 5 returns the value 3, since 5 goes into 8 
  19.          once with a remainder of 3.)  When working on real numbers with a 
  20.          fractional part the modulo operator in COMPUTE rounds off the 
  21.          operands before the division.
  22.  
  23.      The standard order of precedence for arithmetic operations is 
  24.          followed by default.  Multiple levels of parentheses and/or square 
  25.          brackets are supported, however, so that the order in which 
  26.          calculations are made can be modified.  Thus, while COMPUTE 4 + 5 * 2
  27.          returns the value 14, the command COMPUTE (4 + 5) * 2 returns 18.
  28.  
  29.      COMPUTE stores its last calculated result within its own .COM file.  
  30.          This number, designated x, can be recovered and used in the next 
  31.          calculation, whose result becomes the new x.  The value of the 
  32.          currently-stored x can be seen by entering the command COMPUTE x, 
  33.          and x can be used as an operand, as in COMPUTE x + 5.
  34.  
  35.      The program can handle decimal numbers up to 20 digits on either side 
  36.          of the decimal point.  Rounding errors are precluded by using a binary
  37.          coded decimal (BCD) format.  Under DOS 3.x and later, COMPUTE can be 
  38.          renamed to a shorter name to save keystrokes.  Under DOS 2.x, however, 
  39.          the program cannot be renamed and must be stored either in the current
  40.          directory or in one designated in a PATH= statement.
  41.  
  42.  
  43.